package com.log.james.service;

import com.log.james.entity.EventsType;
import com.log.james.mapper.WebLogAttackDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Service
public class WebLogAttackService implements WebLogAttackDao,Serializable{
    @Autowired
    private WebLogAttackDao webLogAttackDao;

    @Override
    public List<EventsType> webAttackType(Date st,Date et) {
        List<EventsType> webAttackList = webLogAttackDao.webAttackType(st,et);
        return webAttackList;
    }

    @Override
    public List<Map<String, Object>> getNewestAttack() {
        List<Map<String,Object>> newestAccackLists = webLogAttackDao.getNewestAttack();
        return newestAccackLists;
    }

    @Override
    public List<Map<String,Object>> srcAttack(Date st,Date et) {
        List<Map<String,Object>> attackSource = webLogAttackDao.srcAttack(st,et);
        return attackSource;
    }

    @Override
    public List<Map<String, Object>> findTodayAttack(Date st, Date et) {
        List<Map<String,Object>> list = webLogAttackDao.findTodayAttack(st,et);
        return list;
    }

    @Override
    public List<Map<String, Object>> findPartMessageByTime(Date st, Date et,String type, int num) {
        List<Map<String,Object>> maps = webLogAttackDao.findPartMessageByTime(st, et,type, num);
        return maps;
    }

    @Override
    public List<Map<String, Object>> findAllMessageByTime(Date st, Date et, String type) {
        List<Map<String,Object>> maps = webLogAttackDao.findAllMessageByTime(st, et, type);
        return maps;
    }

    @Override
    public List<Map<String, Object>> findAttackByStartTime(Date st) {
        List<Map<String,Object>> maps = webLogAttackDao.findAttackByStartTime(st);
        return maps;
    }

    @Override
    public Map<String, Object> findAttackDetailsByTimeAndType(Date st, String type) {
        return  webLogAttackDao.findAttackDetailsByTimeAndType(st, type);
    }

    @Override
    public Map<String, Object> getWeblogDetails(int id) {
        return webLogAttackDao.getWeblogDetails(id);
    }
}
